<template>
	<view class="page">
		<view class="header">
			<!-- <image src="../../static/img/z7124.png" mode="" class="header_bg"></image> -->
			<view class="header-title">我的</view>
		</view>
		<view class="tx">
			<view class="tx-view">
				<image src="../../static/img/tx.png" mode="" class="txImg"></image>
			</view>
		</view>
		<view class="content">
			<view class="name">{{account}}</view>
			<!-- <view class="phone">15910272876</view> -->
			<view class="content-item" @click="go">
				<view class="item-left">
					<view class="item-ico">
						<image src="../../static/img/z7125.png" mode=""></image>
					</view>
					<view class="item-title">会员中心</view>
				</view>
				<view class="item-right">
					<view class="item-hy">
						<image :src="huiImg" mode=""></image>
					</view>
					<view class="item-jt">
						<image src="../../static/img/jt.png" mode=""></image>
					</view>
				</view>

			</view>
			<view class="content-item" @click="gointegral">
				<view class="item-left">
					<view class="item-ico">
						<image src="../../static/img/z7116.png" mode=""></image>
					</view>
					<view class="item-title">我的积分</view>
				</view>
				<view class="item-right">
					<view class="item-jf" style="color: #FE8D03;margin-right: 16rpx;">{{point}}分</view>
					<view class="item-jt">
						<image src="../../static/img/jt.png" mode=""></image>
					</view>
				</view>

			</view>
			<view class="content-item">
				<view class="item-left">
					<view class="item-ico">
						<image src="../../static/img/z1367.png" mode=""></image>
					</view>
					<view class="item-title">账号信息维护</view>
				</view>
				<view class="item-right">
					<!-- <view class="item-hy"> <image src="../../static/img/svip.png" mode=""></image></view> -->
					<view class="item-jt">
						<image src="../../static/img/jt.png" mode=""></image>
					</view>
				</view>

			</view>
			<view class="content-item">
				<view class="item-left">
					<view class="item-ico">
						<image src="../../static/img/z1993.png" mode=""></image>
					</view>
					<view class="item-title">身份信息维护</view>
				</view>
				<view class="item-right">
					<!-- <view class="item-hy"> <image src="../../static/img/svip.png" mode=""></image></view> -->
					<view class="item-jt">
						<image src="../../static/img/jt.png" mode=""></image>
					</view>
				</view>

			</view>
			<view class="content-item">
				<view class="item-left">
					<view class="item-ico">
						<image src="../../static/img/z7117.png" mode=""></image>
					</view>
					<view class="item-title">修改密码</view>
				</view>
				<view class="item-right">
					<!-- <view class="item-hy"> <image src="../../static/img/svip.png" mode=""></image></view> -->
					<view class="item-jt">
						<image src="../../static/img/jt.png" mode=""></image>
					</view>
				</view>

			</view>
			<view class="content-item" style="border: none;">
				<view class="item-left">
					<view class="item-ico">
						<image src="../../static/img/z7420.png" mode=""></image>
					</view>
					<view class="item-title">咨询</view>
				</view>
				<view class="item-right">
					<!-- <view class="item-hy"> <image src="../../static/img/svip.png" mode=""></image></view> -->
					<view class="item-jt">
						<image src="../../static/img/jt.png" mode=""></image>
					</view>
				</view>

			</view>
		</view>
		<view class="Version_number">版本：8.0.13</view>
		<view class="tuc">
			<image src="../../static/img/tuichu.png" mode="" class="tuc-img"></image>
			<view class="tuc-title">退出登录</view>
		</view>
		<!-- <button @click="go">会员中心</button> -->
	</view>
</template>

<script>
	import {
		getUserInfo
	} from '@/api/index.js'
	import {
		getMemberLevel
	} from '@/api/other.js'

	import {
		getUid,
		getUCode,
		isLogin
	} from '@/utils/tools.js'
	export default {

		data() {
			return {
				userInfo: {},
				account: '',
				point: '',
				huiImg: '',
			}
		},
		methods: {
			go() {
				uni.navigateTo({
					url: '/pages/member/member'
				})
			},
			gointegral() {
				uni.navigateTo({
					url: '/pages/integral/integral'
				})
			},
			async getUser() {
				const res = await getUserInfo({
					uid: getUid(),
					ucode: getUCode()
				})
				if (res.status == 1) {
					this.account = res.data.account
					this.point = res.data.point.all
					const res1 = await getMemberLevel({})
					if (res1.status == 1) {
						res1.data.forEach(item => {
							if (res.data.level_name == item.name) {
								this.huiImg = item.ico_url
							}
						})

					}

				}
			}
			// async memberLevel(){
			// 	const res= await getMemberLevel({
			// 		uid:getUid(),
			// 		ucode:getUCode()
			// 	})
			// 	if(res.status == 1){
			// 		  this.account = res.data.account
			// 		  this.point = res.data.point.all
			// 	}
			// }

		},
		onLoad() {

		},
		onShow() {
			if (isLogin() == true) {
				this.getUser()
			} else {
				uni.navigateTo({
					url: '/pages/login/login'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		// min-height: 100vh;
		background-color: #fff;
		position: relative;

		.header {
			width: 750rpx;
			height: 440rpx;
			position: relative;
			padding-top: 108rpx;
			background-image: url(https://www.6dbx.com/static/ydImg/mineBg.png);

			// .header_bg {
			// 	width: 100%;
			// 	height: 100%;
			// 	position: absolute;
			// 	left: 0;
			// 	top: 0;
			// 	// z-index: -1;
			// }
			.header-title {
				// width: 100rpx;
				height: 50rpx;
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 36rpx;
				color: #FFFFFF;
				line-height: 50rpx;
				text-align: center;
				// margin-top: 20rpx;
			}

		}

		.tx {
			width: 750rpx;
			height: 64rpx;
			background: #FFFFFF;
			border-radius: 40rpx 40rpx 0rpx 0rpx;
			position: absolute;
			top: 376rpx;

			.tx-view {
				position: relative;

				.txImg {
					width: 180rpx;
					height: 180rpx;
					margin-top: -116rpx;
					position: absolute;
					left: 50%;
					top: 0;
					transform: translate(-50%, 0);

				}
			}


		}

		.content {
			width: 750rpx;
			background-color: #FFFFFF;
			padding: 20rpx 30rpx;

			.name {
				height: 44rpx;
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: #333333;
				line-height: 44rpx;
				text-align: center;
			}

			.phone {
				height: 44rpx;
				font-family: PingFang SC;
				font-weight: 400;
				font-size: 32rpx;
				color: #A9B1BE;
				line-height: 44rpx;
				letter-spacing: 0.2800000011920929px;
				text-align: center;
				margin-top: 10rpx;
				margin-bottom: 40rpx;
			}

			.content-item {
				width: 100%;
				height: 100rpx;
				background: #FFFFFF;
				border-radius: 0rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-bottom: 1rpx solid #EEEEEE;

				.item-left {
					display: flex;
				}

				.item-ico {
					width: 32rpx;
					height: 28rpx;
					margin-top: 7rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.item-title {
					// width: 120rpx;
					height: 42rpx;
					font-family: PingFang SC;
					font-weight: 400;
					font-size: 30rpx;
					color: #333333;
					line-height: 42rpx;
					margin-left: 10rpx;
				}

				.item-right {
					display: flex;
					float: right;

					.item-hy {
						width: 120rpx;
						height: 40rpx;
						margin-right: 20rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}

					.item-jt {
						width: 12rpx;
						height: 20rpx;

						image {
							width: 100%;
							height: 100%;
						}

						.item-jf {
							height: 42rpx;
							font-family: PingFang SC;
							font-weight: 500;
							font-size: 30rpx;
							color: #FE8D03;
							line-height: 42rpx;


						}
					}
				}
			}

		}

		.Version_number {
			height: 40rpx;
			font-family: PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #ACACAC;
			line-height: 40rpx;
			text-align: center;
			margin-top: 40rpx;
		}

		.tuc {
			margin: 20rpx 30rpx 0 30rpx;
			width: 690rpx;
			height: 88rpx;
			background: linear-gradient(90deg, #F43107 0%, #FF9289 50%, #F43107 100%);
			border-radius: 100rpx;
			padding: 22rpx 250rpx;
			display: flex;

			.tuc-img {
				width: 32rpx;
				height: 30rpx;
				padding: 8rpx;
				margin-right: 10rpx;
			}

			.tuc-title {
				height: 44rpx;
				font-family: PingFang SC;
				font-weight: 600;
				font-size: 32rpx;
				color: #FFFFFF;
				line-height: 44rpx;
			}
		}
	}
</style>